using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;

namespace CustomCMS.API.Util
{
    internal class General
    {
        public static void ReleaseCOMObject(ref object o)
        {
            if (o != null)
            {
                try
                {
                    int i = System.Runtime.InteropServices.Marshal.ReleaseComObject(o);

                    while (i > 0)
                    {
                        i = System.Runtime.InteropServices.Marshal.ReleaseComObject(o);
                    }
                }
                catch (Exception)
                {
                }
                finally
                {
                    o = null;
                }
            }
        }
    }
}
